package com.wenlin.myproduction.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.Gson;
import com.google.gson.annotations.Expose;

import java.util.Objects;

public class TeacherEn implements Parcelable {
    public static final Parcelable.Creator<TeacherEn> CREATOR = new Parcelable.Creator<TeacherEn>() {
        @Override
        public TeacherEn createFromParcel(Parcel source) {
            return new TeacherEn(source);
        }

        @Override
        public TeacherEn[] newArray(int size) {
            return new TeacherEn[size];
        }
    };
    @Expose
    public String Name;
    @Expose
    public String HeadUrl;

    public TeacherEn(String name, String headUrl) {
        this.Name = name;
        this.HeadUrl = headUrl;
    }

    protected TeacherEn(Parcel in) {
        this.Name = in.readString();
        this.HeadUrl = in.readString();
    }

    public String tojson() {
        return new Gson().toJson(this);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.Name);
        dest.writeString(this.HeadUrl);
    }

    @Override
    public boolean equals(Object o) {
        if (o == null) return false;
        if (this == o) return true;
        if (!(o instanceof TeacherEn)) return false;
        TeacherEn teacherEn = (TeacherEn) o;
        return Objects.equals(Name, teacherEn.Name) &&
                Objects.equals(HeadUrl, teacherEn.HeadUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(Name, HeadUrl);
    }
}
